<?php

namespace App\Services\System\Tools;

use App\Services\Service;
use App\Services\Traits\DatabaseMysql;
use App\Models\Game\Log\FishFire;

class FishService extends Service
{
    use DatabaseMysql;

    /**
     * 获取开火日志
     *
     * @param \Illuminate\Http\Request $request
     * @return \Illuminate\Database\Eloquent\Collection[]
     */
    public function getFire($request)
    {
        $query = FishFire::query();

        // 筛选【平台】
        $this->makeWhereParamOrg($request, $query);
        // 筛选【搜索】
        $this->makeWhereParamSearch($request, $query);

        // 排序分页
        $this->makeOrderParam($request, $query)->makePaginationParam($request, $query);
        // 查询数据
        $collection = $query->get()->reverse()->values();

        return [
            $collection,
        ];
    }
}
